import 'package:flutter/material.dart';
import 'package:flutter_base/config/app_color.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class CommonTwoTabBar extends StatelessWidget {
  const CommonTwoTabBar(
      {super.key, required this.tabController, required this.tabs});

  final TabController tabController;
  final List<String> tabs;

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 44.w,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(50.w),
      ),
      padding: EdgeInsets.all(2.w),
      child: TabBar(
          controller: tabController,
          indicator: BoxDecoration(
            borderRadius: BorderRadius.circular(20.w),
            color: AppColor.color0C0A09,
          ),
          indicatorSize: TabBarIndicatorSize.tab,
          // indicatorPadding: EdgeInsets.symmetric(horizontal: 16.w),
          labelColor: Colors.white,
          unselectedLabelColor: AppColor.color0C0A09.withOpacity(0.16),
          labelStyle: TextStyle(
            fontSize: 14.sp,
            fontWeight: FontWeight.w600,
          ),
          unselectedLabelStyle: TextStyle(
            fontSize: 14.sp,
            fontWeight: FontWeight.w500,
          ),
          tabs: tabs.map((item) {
            return Tab(
              text: item,
            );
          }).toList()),
    );
  }
}
